Problem with date comparison

Hi

For each object, I try to compare the date of its "last modified on" attribute with the date of the most recent baseline in order to export it with colors.

But whatever the dates, it finds that the "last modified on" attribute is always infferior to the date of the most recent baseline. That is false.

I remark by debugging the script that the date of the baseline is in french and the date of the attribute is in english. Does it perturb ??


Estebell - Tue Jun 24 05:09:22 EDT 2014

Re: Problem with date comparison
Wolfgang Uhr - Tue Jun 24 05:15:00 EDT 2014

Hi

How do you compare a date with an other date?

Date dtex  =...

Date dteY = ...

if (intOf(dteX) > intOf(dteY)) {
    // ...
}

Bet regards

Wolfgang

Re: Problem with date comparison
Wolfgang Uhr - Tue Jun 24 05:17:27 EDT 2014

Wolfgang Uhr - Tue Jun 24 05:15:00 EDT 2014

Hi

How do you compare a date with an other date?

Date dtex  =...

Date dteY = ...

if (intOf(dteX) > intOf(dteY)) {
    // ...
}

Bet regards

Wolfgang

It is wonderful in this forum. If you post something, it looks horrible. But if you wait 10 Seconds and make a reload, erverything looks well.

Re: Problem with date comparison
Estebell - Tue Jun 24 06:00:13 EDT 2014

Wolfgang Uhr - Tue Jun 24 05:15:00 EDT 2014

Hi

How do you compare a date with an other date?

Date dtex  =...

Date dteY = ...

if (intOf(dteX) > intOf(dteY)) {
    // ...
}

Bet regards

Wolfgang

That's great like this, I compared directly the Dates.

 

Re: Problem with date comparison
llandale - Tue Jun 24 09:02:05 EDT 2014

Last Modified On does not include the seconds.  I don't recall of the baseline date does.  but it if does, then the baseline date will be greater than the last modified date.  If so, perhaps use the "dateOnly" function.

-Louie

Re: Problem with date comparison
Mathias Mamsch - Tue Jun 24 15:43:17 EDT 2014

Estebell - Tue Jun 24 06:00:13 EDT 2014

That's great like this, I compared directly the Dates.

 

Looking at the DOORS perms I see that for dates all comparison operators are defined... Is there a problem with using those?

bool ::== (Date, Date)
bool ::!= (Date, Date)
bool ::< (Date, Date)
bool ::<= (Date, Date)
bool ::> (Date, Date)
bool ::>= (Date, Date)

I think Louies hint regarding the last modification date is very relevant. To read the last modification date of an object/module/link you should use:

Date lastModifiedTime (Link)
Date lastModifiedTime (Object)
Date lastModifiedTime (Module)

Otherwise you will get only the day (not hh:mm:ss) and that will of course give you problems in comparison when baselines and modifications happened at the same day. Regards, Mathias

Re: Problem with date comparison
Wolfgang Uhr - Wed Jun 25 02:27:31 EDT 2014

Mathias Mamsch - Tue Jun 24 15:43:17 EDT 2014

Looking at the DOORS perms I see that for dates all comparison operators are defined... Is there a problem with using those?

bool ::== (Date, Date)
bool ::!= (Date, Date)
bool ::< (Date, Date)
bool ::<= (Date, Date)
bool ::> (Date, Date)
bool ::>= (Date, Date)

I think Louies hint regarding the last modification date is very relevant. To read the last modification date of an object/module/link you should use:

Date lastModifiedTime (Link)
Date lastModifiedTime (Object)
Date lastModifiedTime (Module)

Otherwise you will get only the day (not hh:mm:ss) and that will of course give you problems in comparison when baselines and modifications happened at the same day. Regards, Mathias

Hi Mathias

As far as I remember it - I've tested it some years ago - the comparison is related to the text representation of the date. Therefore sometimes it works correct and sometimes it doesn't.

Best regards

Wolfgang

Re: Problem with date comparison
thsturm - Wed Jul 23 07:55:44 EDT 2014

Mathias Mamsch - Tue Jun 24 15:43:17 EDT 2014

Looking at the DOORS perms I see that for dates all comparison operators are defined... Is there a problem with using those?

bool ::== (Date, Date)
bool ::!= (Date, Date)
bool ::< (Date, Date)
bool ::<= (Date, Date)
bool ::> (Date, Date)
bool ::>= (Date, Date)

I think Louies hint regarding the last modification date is very relevant. To read the last modification date of an object/module/link you should use:

Date lastModifiedTime (Link)
Date lastModifiedTime (Object)
Date lastModifiedTime (Module)

Otherwise you will get only the day (not hh:mm:ss) and that will of course give you problems in comparison when baselines and modifications happened at the same day. Regards, Mathias

Who put the section of "Link History" in the documentation?

I have read carfully the "New in DXL ..." section and nothing found.

 

Thank you for this hint :-)